package com.hedgehoglab.fixxclipse.services;

import java.util.ArrayList;
import java.util.List;

import com.hedgehoglab.fixx.wrapper.*;
import com.hedgehoglab.fixxclipse.treeviewer.model.Fixx;
import com.hedgehoglab.fixxclipse.treeviewer.model.Project;
public class ProjectService {
	Projects projects = new Projects();
	
	public List<Project> getProject(String projectId, Fixx parent){
		
		List<FixxProject> p = projects.getProject(projectId);
		List<Project> projectsList = new ArrayList<Project>();
		for(FixxProject proj:p){
			Project f = new Project();
			f.setName(proj.getName());
			f.setParent(parent);	
			projectsList.add(f);
		}
		return projectsList;
		
	}
//	public List<Project> getProjects(Fixx parent){
//		List<FixxProject> p = projects.getProjects();
//		List<Project> projectsList = new ArrayList<Project>();
//		for(FixxProject proj:p){
//			Project f = new Project();
//			f.setName(proj.getName());
//			f.setParent(parent);	
//			projectsList.add(f);
//		}
//		return projectsList;
//		
//	}


}
